<?php
class testController extends RPHP_Controller
{


    public function index()
    {

        /*  /*  $m    = $this->model;
            $user = $m->checkAuth();*/
        //if ($user) {
        $m    = $this->model;
            $next = true;

            /*          if ($_GET['recode'] != "") {
                          $recode = addslashes($_GET['recode']);
                          if ($recode != '') {
                              $_SESSION['qrcode_recode'] = $recode;
                          }
                      } else {
                          $pro = $m->getRecode();
                          if ($pro['recode'] != "") {
                              $this->redirect("/?recode=" . $pro['recode']);
                              $next = false;
                          }
                      }*/

            if ($next) {
                //$this->view->JSAPI = $m->getJSApiData();
                //dd($this->view->JSAPI);
                $data = $m->indexList();
                //dd($data);
                $this->view->data = $data;
               // $this->view->user = $user;
                $this->display();
            }

            // }

        }

   // }

    public function ajaxSpecial()
    {


        $m    = $this->model;
        $user = $m->checkAuth();
        if ($user) {

            $data = $m->ajaxGetSpecial();

            echo json_encode($data);die();
        }
        // $this->table("today_special")->findBy
    }


}
